home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / graphic / rtetc800.zip / RTDOCS.ZIP / SCN2SFF.LST < prev    next >
File List  |  1992-07-27  |  21KB  |  567 lines

  1.  
  2.                                                       SCN2SFF(1G)
  3.  
  4. NAME
  5.      scn2sff - format conversion program
  6.  
  7. SYNOPSIS
  8.      scn2sff [options] {SCNfile|-} [>SFFfile]
  9.  
  10. AUTHOR
  11.      Antonio Costa, INESC-Norte, 1991 1992
  12.  
  13. DESCRIPTION
  14.      _s_c_n_2_s_f_f command performs conversion between a text format
  15.      (SCN) suitable for scene descriptions to another more simple
  16.      text format (SFF) that is accepted by the _r_t_r_a_c_e ray-tracer
  17.      program.  The SCN text file describes objects, lights, sur-
  18.      face definitions, textures, etc.  The scene format is
  19.      described bellow.
  20.  
  21. OPTIONS
  22.      [C]
  23.      The parameter _C tells the program to preprocess the input
  24.      file through the UNIX standard preprocessor (/usr/lib/cpp
  25.      with option -P).
  26.  
  27.      [M]
  28.      The parameter _M tells the program to preprocess the input
  29.      file through the M4 preprocessor (/usr/bin/m4).
  30.  
  31.      [P"_p_r_e_p_r_o_c_e_s_s_o_r _c_o_m_m_a_n_d"]
  32.      The parameter _P tells the program to preprocess the input
  33.      file through the command described (for example,
  34.      P"/usr/lib/cpp -P -Dabc").
  35.  
  36. RESTRICTIONS
  37.      None for the moment.
  38.  
  39. BUGS
  40.      No bugs known.  They have to be hidden deep somewhere, as
  41.      usual.
  42.  
  43. DESCRIPTION
  44.      Comments start with % ; or # characters and continue to the
  45.      end of the line (so there are no nested comments).
  46.  
  47.      The commands are processed from the start of the scene, and
  48.      some have a global effect until they are changed or the
  49.      scene is complete. Such commands are _r_e_f_r_a_c_t_i_o_n, _s_u_r_f_a_c_e,
  50.      _t_r_a_n_s_f_o_r_m_a_t_i_o_n_s and _t_e_x_t_u_r_e_s; as commands can be nested by
  51.      grouping, any command defined inside a group is removed when
  52.      that group is finished.
  53.  
  54.      Example:
  55.  
  56.      surface matte white        % current surface is matte white
  57.      refraction 1.1             % current refraction index
  58.      transform rotate x 15      % transformation
  59.      group                      % start of a group of commands
  60.        surface matte red        % new current surface
  61.        transform scale 2        % transformation
  62.        sphere 0 0 0 1           % sphere object
  63.      ungroup                    % end of group
  64.      % back to matte white surface, refraction 1.1
  65.      % scale transformation is removed
  66.  
  67.                          ENTITIES
  68.  
  69.      The main entities are:
  70.  
  71.      _i_n_t_e_g_e_r - it can be a simple number, an integer expression
  72.      enclosed in parenthesis or the _i_n_t function applied to any
  73.      real expression.
  74.  
  75.      _r_e_a_l - a number, a function or an expression enclosed in
  76.      parenthesis.
  77.  
  78.      _c_o_l_o_r - a triplet of RGB real values between 0 and 1 (in
  79.      certain cases, it is allowed to be greater than 1 or nega-
  80.      tive; called _c_o_l_o_r__e_x_t_e_n_d_e_d) or a name (like _r_e_d, _b_l_u_e,
  81.      etc).
  82.  
  83.      _p_o_i_n_t - a triplet of XYZ values (numbers, functions or
  84.      expressions).
  85.  
  86.      _v_e_c_t_o_r - similar to point, but the 3 components cannot be
  87.      simultaneously equal to 0.
  88.  
  89.      _f_i_l_e_n_a_m_e - a set of characters with no blanks between.
  90.  
  91.      _e_x_p_r_e_s_s_i_o_n - anything enclosed in parenthesis. Operators are
  92.      +, -, *, /, ^ (exponentiation) and | (remainder).
  93.  
  94.      _f_u_n_c_t_i_o_n - there are many functions available: _i_n_t _s_i_n _c_o_s
  95.      _t_a_n _a_s_i_n _a_c_o_s _a_t_a_n _s_q_r_t _r_t_o_d _d_t_o_r _e_x_p _l_o_g _a_b_s _m_a_x _m_i_n. There
  96.      also some functions that operate with vectors and return a
  97.      number (_d_o_t_v_e_c_t_o_r) and some that return a vector or point
  98.      (_n_o_r_m_v_e_c_t_o_r _a_d_d_v_e_c_t_o_r _d_i_f_f_v_e_c_t_o_r _s_c_a_l_e_v_e_c_t_o_r _c_r_o_s_s_v_e_c_t_o_r).
  99.      There is also an operator _m_o_n_o that converts from a value to
  100.      3 identical values (good for specifying monochromatic
  101.      colors).
  102.  
  103.                          GENERAL COMMANDS
  104.  
  105.      The main commands are:
  106.  
  107.      _e_y_e (_f_r_o_m) point - default {5,0,0}.
  108.  
  109.      _l_o_o_k (_a_t) point - default {0,0,0}.
  110.  
  111.      _u_p vector - default {0,1,0}.
  112.  
  113.      _a_n_g_l_e (_f_o_v) horizontal [vertical] - half aperture view in
  114.      degrees (default 22.5 degrees).
  115.  
  116.      _b_a_c_k_g_r_o_u_n_d color - the color of the background, at infinite
  117.      distance (default light_sky_blue).
  118.  
  119.      _a_m_b_i_e_n_t color - the diffuse light that illuminates the whole
  120.      scene (default is {0.1,0.1,0.1}).
  121.  
  122.      _r_e_f_r_a_c_t_i_o_n (_i_o_r) index - default is 1.
  123.  
  124.      _g_r_o_u_p ... _u_n_g_r_o_u_p - anything enclosed is only defined inside
  125.      the block, ie, it does not apply outside.
  126.  
  127.                          LIGHT COMMANDS
  128.  
  129.      The commands for definition of light sources are:
  130.  
  131.      _l_i_g_h_t _p_o_i_n_t point [color_extended] - default color for
  132.      lights is white.
  133.  
  134.      _l_i_g_h_t _d_i_r_e_c_t_i_o_n_a_l vector [color].
  135.  
  136.      _l_i_g_h_t _s_p_o_t point vector color_extended [angle [factor]] -
  137.      the light illuminates inside a cone defined by the angle
  138.      (default 45 degrees) and the transition can be sharp if fac-
  139.      tor is near 1 or smooth if factor >> 1 (default 1).
  140.  
  141.      _l_i_g_h_t _e_x_t_e_n_d_e_d point color_extended radius samples - a
  142.      spherical light (it is sampled by samples^2 rays).
  143.  
  144.                          SURFACE COMMANDS
  145.  
  146.      The commands for definition of surfaces are:
  147.  
  148.      _s_u_r_f_a_c_e color [diffusion specularity phong metalness [tran-
  149.      sparency]] - phong and metalness are values, the others are
  150.      colors (defaults {0.9,0.9,0.9} {0.1,0.1,0.1} 3 0
  151.      {0.1,0.1,0.1} or transparency only {0,0,0}).
  152.  
  153.      _s_u_r_f_a_c_e _s_t_r_a_u_s_s color smoothness metalness [transparency] -
  154.      all colors (default transparency is {0,0,0}).
  155.  
  156.      _s_u_r_f_a_c_e _m_a_t_t_e color - all diffuse surface.
  157.  
  158.      _s_u_r_f_a_c_e _p_l_a_s_t_i_c color smoothness phong - surface with big
  159.      diffusion, small specularity and small phong factor.
  160.  
  161.      _s_u_r_f_a_c_e _m_e_t_a_l color smoothness phong - surface with small
  162.      diffusion, big specularity, big phong factor and metalness
  163.      factor equal to 1.
  164.  
  165.      _s_u_r_f_a_c_e _d_i_e_l_e_c_t_r_i_c color transparency refraction - tran-
  166.      sparent surface with no diffusion, some specularity, large
  167.      phong factor and null metalness.
  168.  
  169.      _s_u_r_f_a_c_e _g_l_a_s_s color transparency - transparent surface with
  170.      refraction index equal to 1.52, approximately.
  171.  
  172.                          OBJECT COMMANDS
  173.  
  174.      The commands for objects are of the form
  175.           _o_b_j_e_c_t object_data
  176.      or else with local commands that apply only to itself of the
  177.      form
  178.           _o_b_j_e_c_t [attributes ... _d_a_t_a] object_data.
  179.  
  180.      _s_p_h_e_r_e center radius.
  181.  
  182.      _b_o_x center sizes - this is an axis-aligned box.
  183.  
  184.      _c_u_b_e center size - again it is axis-aligned.
  185.  
  186.      _c_o_n_e apex base base_radius - closed cone.
  187.  
  188.      _c_o_n_e _o_p_e_n apex base base_radius.
  189.  
  190.      _c_y_l_i_n_d_e_r apex base radius - closed cylinder.
  191.  
  192.      _c_y_l_i_n_d_e_r _o_p_e_n apex base radius.
  193.  
  194.      _c_o_n_e _t_r_u_n_c_a_t_e_d apex apex_radius base base_radius - closed.
  195.  
  196.      _c_o_n_e _t_r_u_n_c_a_t_e_d _o_p_e_n apex apex_radius base base_radius.
  197.  
  198.      _w_e_d_g_e point point point depth - defined by a triangular face
  199.      and depth (face is defined counterclockwise so that depth is
  200.      measured in the opposite direction of Rigth Hand Rule thumb;
  201.      this convention also applies to other objects).
  202.  
  203.      _t_e_t_r_a point point point point.
  204.  
  205.      _p_r_i_s_m depth number_vertices point ... point - closed prism.